package com.yami.shop.service;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yami.shop.bean.model.PurchaseOrder;
import com.yami.shop.bean.vo.ExcelInfoVO;
import com.yami.shop.common.util.PageParam;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;

/**
 *
 *
 * @author YXF
 * @date 2021-09-08 10:42:01
 */
public interface PurchaseOrderService extends IService<PurchaseOrder> {

    /**
     * 分页
     * @param page
     * @param purchaseOrder
     * @return
     */
    IPage<PurchaseOrder> pagePurchaseOrder(PageParam<PurchaseOrder> page, PurchaseOrder purchaseOrder);
    /**
     * 保存
     * @param purchaseOrder
     */
    void savePurchaseOrder(PurchaseOrder purchaseOrder);

    /**
     * 采购订单信息
     * @param purchaseOrderId
     * @return
     */
    PurchaseOrder info(Long purchaseOrderId);

    /**
     * 入库
     * @param purchaseOrder
     * @return
     */
    void inbound(PurchaseOrder purchaseOrder);

    /**
     * 作废
     * @param shopId
     * @param purchaseOrderId
     */
    void nullify(Long shopId, Long purchaseOrderId);

    /**
     * 完成采购订单
     * @param shopId
     * @param purchaseOrderId
     */
    void complete(Long shopId, Long purchaseOrderId);

    /**
     * 下载模板（新增采购）
     * @param response
     */
    void downloadModel(HttpServletResponse response);

    /**
     * 导入excel（新增采购）
     * @param excelFile
     * @param shopId
     * @param supplierId
     * @return
     */
    ExcelInfoVO parseFile(MultipartFile excelFile, Long shopId, Long supplierId);

    /**
     * 导出excel（采购入库）
     * @param purchaseOrder
     * @param response
     */
    void export(PurchaseOrder purchaseOrder, HttpServletResponse response);

    /**
     * 下载模板（采购入库）
     * @param response
     */
    void inboundDownloadModel(HttpServletResponse response);

    /**
     * 导入excel（采购入库）
     * @param excelFile
     * @param shopId
     * @param purchaseOrderId
     * @return
     */
    ExcelInfoVO inboundParseFile(MultipartFile excelFile, Long shopId, Long purchaseOrderId);
}
